package scyExam

import (
	"github.com/gin-gonic/gin"
	"likeadmin/clog"
	"likeadmin/dbc"
	"likeadmin/model"
	"likeadmin/sqlop"
	"likeadmin/webu"
	"time"
)

func CreateScyExam(c *gin.Context) {
	scyExam := &model.ScyExam{}
	c.ShouldBind(scyExam)
	scyExam.CreateTime = time.Now().Unix()
	clog.Info("scyExam,CreateScyExam,scyExam=", scyExam)
	err := dbc.DB.Create(scyExam).Error
	webu.GinResult("CreateScyExam Error:", c, err)
}

func UpdateScyExam(c *gin.Context) {
	/*	scyExam := &model.ScyExam{}
		c.ShouldBind(scyExam)
		clog.Info("scyExam,UpdateScyExam,scyExam=", scyExam)
		err := sqlop.ExecFourP("update scy_exam set scy_exam_name=?,scy_exam_introduction=?,update_time=? where id=?", scyExam.ScyExamName, scyExam.ScyExamIntroduction, time.Now().Unix(), scyExam.Id)
		webu.GinResult("UpdateScyExam Error:", c, err)*/

}

func DeleteScyExam(c *gin.Context) {
	scyExam := &model.ScyExam{}
	c.ShouldBind(scyExam)
	clog.Info("scyExam,DeleteScyExam,scyExam=", scyExam)
	err := sqlop.ExecTwoP("update scy_exam set is_deleted=1,delete_time=? where id=?", time.Now().Unix(), scyExam.Id)
	webu.GinResult("DeleteScyExam Error:", c, err)
}
